/**
 * 首页图片列表 add by gsh
 */
$(function() {
	$("#chkAll").change(function() {
		var chkStatus = $(this).is(":checked");
		$("[id^=chk]:not(#chkAll)").each(function() {
			this.checked = chkStatus;
		});
	});
});

function checkData(frm){
	var isValid = validator(frm);

	return isValid;	
}

function process(id) {
	var index = msgWnd.open({
		title : "处理留言",
		skin : 'layui-layer-lan',
		type : 2,
		shade : 0.5,
		area : [ "550px", "430px" ],
		maxmin : true,
		content : '/feedback/process/' + id,
		zIndex : layer.zIndex
	});
}

function deleteMsg(_id) {
	var index = msgWnd.confirm("确认删除吗?", {
		title : "删除",
		skin : 'layui-layer-lan',
		btn : [ "确定", "取消" ],
		icon : 1
	}, function() {
		$.ajax({
			type : "POST",
			url : "/feedback/" + _id,
			type:"delete",
			dataType : "json",
			success : function(msg) {
				if (msg.data.status == 1) {
					msgTools.alert("删除留言", "删除成功。", 1000);
					if(typeof(reloadPg)!="undefined")
						reloadPg();
					else
						window.location.href = window.location.href;
				} else {
					msgTools.alert("删除留言", "删除失败。", 2000);
				}
			}
		});		
		msgWnd.close(index);
	});
}
